package 多线程.插队;

public class Example implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            if (i==2){
                try {
                    System.out.println(Thread.currentThread().getName()+"插队");
                    Thread.yield();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            System.out.println(Thread.currentThread().getName()+"---"+i);
        }
    }
}
